chore(1-3133): change avg health to current health in project status #8803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the project status service (and schemas and UI) to use the project's current health instead of the 4-week average.
I nabbed the
calculateHealthRating
fromsrc/lib/services/project-health-service.ts
instead of relying on the service itself, because that service relies on the project service, which relies on pretty much everything in the entire system.However, I think we can split the health service into a service that does need the project service (which is used for 1 of 3 methods) and a service (or read model) that doesn't. We could then rely on the second one for this service without too much overhead. Or we could extract the
calculateHealthRating
into a shared function that takes its stores as arguments. ... but I suggest doing that in a follow-up PR.Because the calculation has been tested other places (especially if we rely on a service / shared function for it), I've simplified the tests to just verify that it's present.
I've changed the schema's
averageHealth
into an object in case we want to include average health etc. in the future, but this is up for debate.